-- ABNF module extracted from ITU-T T.808 (V2) (12/2022)
;=================================
; C.1.1 Request structure
;=================================
jpip-request-field = target-field / channel-field / view-window-field / metadata-field / data-limit-field / server-control-field / cache-management-field / upload-field / client-cap-pref-field
target-field = target ; C.2.2 / subtarget ; C.2.3 / tid ; C.2.4
channel-field = cid ; C.3.2 / cnew ; C.3.3 / cclose ; C.3.4 / qid ; C.3.5
view-window-field = fsiz ; C.4.2 / roff ; C.4.3 / rsiz ; C.4.4 / fvsiz ; C.4.5 / rvoff ; C.4.6 / rvsiz ; C.4.7 / comps ; C.4.8 / stream ; C.4.9 / context ; C.4.10 / srate ; C.4.11 / roi ; C.4.12 / layers ; C.4.13
/ mctres ; C.4.14
metadata-field = metareq ; C.5.2
data-limit-field = len ; C.6.1 / quality ; C.6.2
server-control-field = align ; C.7.1 / wait ; C.7.2 / type ; C.7.3 / drate ; C.7.4
/ sendto ; C.7.5 / abandon ; C.7.6 / barrier ; C.7.7 / twait ; C.7.8
cache-management-field = model ; C.8.1 / tpmodel ; C.8.3 / need ; C.8.4 / tpneed ; C.8.5 / mset ; C.8.6
upload-field = upload ; C.9.1
client-cap-pref-field = cap ; C.10.1 / pref ; C.10.2 / csf ; C.10.3
/ handled ; C.10.4
=================================
; C.2.2 Target(target)
;=================================
target = "target" "=" PATH
;=================================
; C.2.3 Sub-target (subtarget)
;=================================
subtarget = "subtarget" "=" byte-range
byte-range = UINT-RANGE
;=================================
; C.2.4 Target ID (tid)
;=================================
tid = "tid" "=" target-id
target-id = TOKEN
;=================================
; C.3.1 Channel ID (cid)
;=================================
cid = "cid" "=" channel-id
channel-id = TOKEN
;=================================
; C.3.2 New Channel (cnew)
;=================================
cnew = "cnew" "=" 1#transport-name
transport-name = TOKEN
;=================================
; C.3.3 Channel Close (cclose)
;=================================
cclose = "cclose" "=" ("*" / 1#channel-id)
;=================================
; C.3.4 Request ID (qid)
;=================================
qid = "qid" "=" UINT
;=================================
; C.4.2 Frame Size (fsiz)
;=================================
fsiz = "fsiz" "=" fx "," fy ["," round-direction]
fx = UINT
fy = UINT
round-direction = "round-up" / "round-down" / "closest"
;=================================
; C.4.3 Offset (roff)
;=================================
roff = "roff" "=" ox "," oy
ox = UINT
oy = UINT
;=================================
; C.4.4 Region Size (rsiz)
;=================================
rsiz = "rsiz" "=" sx "," sy
sx = UINT
sy = UINT
;=================================
; C.4.5 Frame Size for Variable Dimension Data (fvsiz)
;=================================
fvsiz = "fvsiz" "=" 1#UINT ["," round-direction]
round-direction = "round-up" / "round-down" / "closest"
;=================================
; C.4.6 Offset for Variable Dimension Data (rvoff)
;=================================
rvoff = "rvoff" "=" 1#UINT
;=================================
; C.4.7 Region Size for Variable Dimension Data(rvsiz)
;=================================
rvsiz = "rvsiz" "=" 1#UINT
;=================================
; C.4.8 Components (comps)
;=================================
comps = "comps" "=" 1#UINT-RANGE
;=================================
; C.4.9 Codestream (stream)
;=================================
stream = "stream" "=" 1#sampled-range
sampled-range = UINT-RANGE [":" sampling-factor]
sampling-factor = UINT
;=================================
; C.4.10 Codestream Context (context)
;=================================
context = "context" "=" 1#context-range
context-range = jpxl-context-range / mj2t-context / reserved-context
jpxl-context-range = "jpxl" "<" jpx-layers ">" [ "[" jpxl-geometry "]" ]
jpx-layers = sampled-range
jpxl-geometry = "s" jpx-iset "i" jpx-inum
jpx-iset = UINT
jpx-inum = UINT
mj2t-context = "mj2t" "<" mj2-track ">" [ "[" mj2t-geometry "]" ]
mj2-track = NONZERO ["+" "now" ]
mj2t-geometry = "track" / "movie"
reserved-context = 1*( TOKEN / "<" / ">" / "[" / "]" / "-" / ":" / "+" )
;=================================
; C.4.11 Sampling Rate (srate)
;=================================
srate = "srate" "=" streams-per-second
streams-per-second = UFLOAT
;=================================
; C.4.12 ROI (roi)
;=================================
roi = "roi" "=" region-name
region-name = 1*(DIGIT / ALPHA / "_") / "dynamic"
;=================================
; C.4.13 Layers (layers)
;=================================
layers = "layers" "=" UINT
;=================================
; C.4.14 Multi-component transformation (MCT) resolution value (mctres)
;=================================
mctres = "mctres" "=" UINT
;=================================
; C.5.2 Metadata Request (metareq)
;=================================
metareq = "metareq" "=" 1#("[" 1$(req-box-prop) "]" [root-bin] [max-depth]) [metadata-only]
req-box-prop = box-type [limit] [metareq-qualifier] [priority]
limit = ":" (UINT / "r")
metareq-qualifier = "/" 1*("w" / "s" / "g" / "a")
priority = "!"
root-bin = "R" UINT
max-depth = "D" UINT
metadata-only = "!!"
;=================================
; C.6.1 Maximum Response Length (len)
;=================================
len = "len" "=" UINT
;=================================
; C.6.2 Quality (quality)
;=================================
quality = "quality" "=" (1*2DIGIT / "100") ; 0 to 100
;=================================
; C.7.1 Alignment (align)
;=================================
align = "align" "=" ("yes" / "no")
;=================================
; C.7.2 Wait (wait)
;=================================
wait = "wait" "=" ("yes" / "no")
;=================================
; C.7.3 Image Return Type (type)
;=================================
type = "type" "=" 1#image-return-type
image-return-type = media-type / reserved-image-return-type
media-type = TOKEN "/" TOKEN *( ";" parameter )
reserved-image-return-type = TOKEN *( ";" parameter )
parameter = attribute "=" value
attribute = TOKEN
value = TOKEN
;=================================
; C.7.4 Delivery Rate (drate)
;=================================
drate = "drate" "=" rate-factor
rate-factor = UFLOAT
;=================================
; C.7.5 Send To (sendto)
;=================================
sendto = "sendto" "=" host ":" port ";" mbw ";" bpc
host = token
port = UINT
bpc = UINT
;=================================
; C.7.6 Abandon (abandon)
;=================================
abandon = "abandon" "=" 1#chunk-range
chunk-range = chunk-qid ":" chunk-seq-range
chunk-qid = UINT
chunk-seq-range = UINT-RANGE
;=================================
; C.7.7 Barrier (barrier)
;=================================
barrier = "barrier" "=" barrier-qid
barrier-qid = UINT
;=================================
; C.7.8 Timed wait (twait)
;=================================
twait = "twait" "=" max-wait-usecs
max-wait-usecs = UINT
;=================================
; C.8.1.1 Model (model)
;=================================
model = "model" "=" 1#model-item
model-item = [codestream-qualifier ","] model-element
model-element = ["-"] bin-descriptor
bin-descriptor = explicit-bin-descriptor ; C.8.1.2 / implicit-bin-descriptor ; C.8.1.3
codestream-qualifier = "[" 1$(codestream-range) "]"
codestream-range = first-codestream-id ["-" [last-codestream-id]]
first-codestream-id = UINT
last-codestream-id = UINT
;=================================
; C.8.1.2 Explicit Form
;=================================
explicit-bin-descriptor = explicit-bin [":" (number-of-bytes / number-of-layers )]
explicit-bin = codestream-main-header-bin / meta-bin / tile-bin / tile-header-bin / precinct-bin
number-of-bytes = UINT
number-of-layers = %x4c UINT ; "L"
codestream-main-header-bin = %x48 %x6d ; "Hm"
meta-bin = %x4d bin-uid ; "M"
tile-bin = %x54 bin-uid ; "T"
tile-header-bin = %x48 bin-uid ; "H"
precinct-bin = %x50 bin-uid ; "P"
bin-uid = UINT / "*"
;=================================
; C.8.1.3 Implicit Form
;=================================
implicit-bin-descriptor = 1*implicit-bin [":" number-of-layers]
implicit-bin = implicit-bin-prefix (data-uid / index-range-spec)
implicit-bin-prefix = %x74 ; t -- tile / %x63 ; c -- component / %x72 ; r -- resolution level / %x70 ; p -- position
index-range-spec = first-index-pos "-" last-index-pos
first-index-pos = UINT
last-index-pos = UINT
data-uid = UINT / "*"
;=================================
; C.8.3 Tile-part Model involving JPT-streams (tpmodel)
;=================================
tpmodel = "tpmodel" "=" 1#tpmodel-item
tpmodel-item = [codestream-qualifier "," ] tpmodel-element
tpmodel-element = ["-"] tp-descriptor
tp-descriptor = tp-range / tp-number
tp-range = tp-number "-" tp-number
tp-number = tile-number "." part-number
tile-number = UINT
part-number = UINT
;=================================
; C.8.4 Need for Stateless Requests (need)
;=================================
need = "need" "=" 1#need-item
need-item = [codestream-qualifier "," ] bin-descriptor
;=================================
; C.8.5 Tile-part Need for Stateless Requests (tpneed)
;=================================
tpneed = "tpneed" "=" 1#tpneed-item
tpneed-item = [codes
;=================================
; C.8.6 Model Set for Requests within a session (mset)
;=================================
mset = "mset" "=" 1#sampled-range
;=================================
; C.9.1 Upload (upload)
;=================================
upload = "upload" "=" upload-type
upload-type = image-return-type ; C.7.3
;=================================
; C.10.1 Client Capability (cap)
;=================================
cap = "cap" "=" 1#capability-group
capability-group = processing-capability / depth-capability / config-capability
processing-capability = compatibility-capability / vendor-capability
compatibility-capability = "cc." compatibility-code
vendor-capability = "vc." vendor-code [":" vendor-value]
vendor-code = 1*(LOWER / DIGIT / "." / "-")
vendor-value = TOKEN
depth-capability = "depth:" UINT
config-capability = "config:" UINT
;=================================
; C.10.2.1 General
;=================================
pref = "pref" "=" 1#(related-pref-set ["/r"])
related-pref-set = view-window-pref ; C.10.2.2 / colour-meth-pref ; C.10.2.3 / max-bandwidth ; C.10.2.4 / bandwidth-slice ; C.10.2.5 / placeholder-pref ; C.10.2.6 / codestream-seq-pref ; C.10.2.7 / conciseness-pref ; C.10.2.8 / other
other = TOKEN
;=================================
; C.10.2.2 View-window handling preferences
;=================================
view-window-pref = "fullwindow" / "progressive"
;=================================
; C.10.2.3 Colour space method preference
;=================================
color-meth-pref = 1$(color-meth [":" meth-limit])
color-meth = "color-enum" / "color-ricc" / "color-icc" / "color-vend"
meth-limit = UINT
;=================================
; C.10.2.4 Max bandwidth
;=================================
max-bandwidth = "mbw:" mbw
mbw = UINT ["K" / "M" / "G" / "T"]
;=================================
; C.10.2.5 Bandwidth slice
;=================================
bandwidth-slice = "slice:" slice
slice = NONZERO
;=================================
; C.10.2.6 Placeholder preference
;=================================
placeholder-pref = "meta:" placeholder-branch
placeholder-branch = "incr" / "equiv" / "orig"
;=================================
; C.10.2.7 Codestream sequencing
;=================================
codestream-seq-pref = "codeseq:" codestream-seq-option
codestream-seq-option = "sequential" / "reverse-sequential" / "interleaved"
;=================================
; C.10.2.8 Conciseness preference
;=================================
conciseness-pref = "loose" / "concise"
;=================================
; C.10.3 Contrast sensitivity (csf)
;=================================
csf = "csf" "=" 1#csf-sample-line
csf-sample-line = csf-density [";" csf-angle] ";" 1$sensitivity
csf-density = "density" ":" UFLOAT
csf-angle = "angle" ":" UFLOAT
sensitivity = UFLOAT
;=================================
; C.10.4 Handled (handled)
;=================================
handled = "handled"